<html>
<head>
<title>${ware.rich.title}</title>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
${css:weboo}
${css:wares}
${js:weboo}
${js:wares}
<style rel="styleshee" type="text/css">
#img-src
{
color:#AAAA77;
background-color:#FFFFAA;
}
</style>
<script language="JavaScript">
function bold()
{
	window.editor.document.execCommand("Bold", false, null);
}
//---------------------------------------------------------------
function italic()
{
	window.editor.document.execCommand("Italic", false, null);
}
//---------------------------------------------------------------
function underline()
{
	window.editor.document.execCommand("Underline", false, null);
}
//---------------------------------------------------------------
function undo()
{
	window.editor.document.execCommand("undo",false,null);
}
//---------------------------------------------------------------
function redo()
{
	window.editor.document.execCommand("redo",false,null);
}
//---------------------------------------------------------------
function left()
{
	window.editor.document.execCommand("JustifyLeft",false,null);
}
//---------------------------------------------------------------
function center()
{
	window.editor.document.execCommand("JustifyCenter",false,null);
}
//---------------------------------------------------------------
function right()
{
	window.editor.document.execCommand("JustifyRight",false,null);
}
//---------------------------------------------------------------
function clearFormat()
{
	window.editor.document.execCommand("RemoveFormat",false,null);
}
//---------------------------------------------------------------
function showImgList()
{
	var o = document.getElementById("thumbnail");
	o.style.display="block";
	o.style.left = (document.body.clientWidth - o.offsetWidth)/2;
	o.style.top = (document.body.clientHeight - o.offsetHeight)/2;
}
//---------------------------------------------------------------
function hideImgList()
{
	var o = document.getElementById("thumbnail");
	o.style.display="none";
}
//---------------------------------------------------------------
function setImgSrc(src)
{
	var o = document.getElementById("img-src");
	o.innerHTML = src;
}
//---------------------------------------------------------------
function insertImgSrc()
{
	var o = document.getElementById("img-src");
	var s = document.location.href;
	var pos = s.indexOf("/",8);
	var domain = s.substring(0,pos);
	var src = domain+o.innerHTML+"?"+Date().toString().replace(/ |:/g,"");
	window.editor.document.execCommand("insertimage",false,src);
	hideImgList();
}
//---------------------------------------------------------------
function getContent()
{
	return encodeURIComponent(window.editor.document.body.innerHTML);
}
//---------------------------------------------------------------
function setContent(s)
{
	window.editor.document.body.innerHTML = s;
}
//---------------------------------------------------------------
function setDesignMode()
{
	try
	{
		window.editor.document.designMode = "on";
		window.editor.focus();
	}
	catch(E)
	{
	}
}
//---------------------------------------------------------------
</script>
</head>
<body>
<table id="thumbnail" cellspacing="0" cellpadding="0" border="0"
style="position:absolute;display:none;background-color:#FFFFFF;border:1px solid #AAAA77;">
	<tr height="20">
		<td bgcolor="#CCCC99" style="border-bottom:1px solid #AAAA77;">
			<table border="0" width="100%"><tr>
				<td>
					<a href="javascript:void(0)" onclick="insertImgSrc()">${msg:rich.img.add}</a> : 
					<span id="img-src"></span>
				</td>
				<td align="right"><img src="${icon:eve:close}" style="cursor:pointer" class="icon16" onclick="hideImgList()"></td>
			</tr></table>
		</td>
	</tr>
	<tr>
		<td>
			<iframe frameborder="0" width="530" height="336"
			src="http://ihelpuoo:8080/khcore/upload/thumbnail.o?callback=parent.setImgSrc&pn=1&pagesize=10"></iframe>
		</td>
	</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
<tr height="20">
	<td class="toolbar">
		<table border="0" cellspacing="0" cellpadding="0"><tr>
			<td><img src="${icon:thandle}" class="icon16"/></td>
			<td><img src="${icon:bold}" class="btn" title="${msg:rich.b}" onclick="bold()"/></td>
			<td><img src="${icon:italic}" class="btn" title="${msg:rich.i}" onclick="italic()"/></td>
			<td><img src="${icon:underline}" class="btn" title="${msg:rich.u}" onclick="underline()"/></td>
			<td><img src="${icon:seg}" class="icon16"/></td>
			<td><img src="${icon:undo}" class="btn" title="${msg:rich.undo}" onclick="undo()"/></td>
			<td><img src="${icon:redo}" class="btn" title="${msg:rich.redo}" onclick="redo()"/></td>
			<td><img src="${icon:seg}" class="icon16"/></td>
			<td><img src="${icon:left}" class="btn" title="${msg:rich.left}" onclick="left()"/></td>
			<td><img src="${icon:center}" class="btn" title="${msg:rich.center}" onclick="center()"/></td>
			<td><img src="${icon:right}" class="btn" title="${msg:rich.right}" onclick="right()"/></td>
			<td><img src="${icon:seg}" class="icon16"/></td>
			<td><img src="${icon:link}" class="btn" title="${msg:rich.link}"/></td>
			<td><img src="${icon:unlink}" class="btn" title="${msg:rich.unlink}"/></td>
			<td><img src="${icon:image}" class="btn" title="${msg:rich.img}" onclick="showImgList(this)"/></td>
			<td><img src="${icon:seg}" class="icon16"/></td>
			<td><img src="${icon:clear}" class="btn" title="${msg:rich.clear}" onclick="clearFormat()"/></td>
		</tr></table>
	</td>
</tr>
<tr>
	<td>
		<iframe name="editor" frameborder="0" width="100%" height="100%"></iframe>
	</td>
</tr>
</table>
</body>
</html>
<script language="JavaScript">
ihelpuoo.logLevel = 5;
ihelpuoo.http.server().rootPath = "${appRoot}";
ihelpuoo.http.server().module = "${module}";

window.onload = function()
{
	setDesignMode();
}
</script>